<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>DOM节点借用Array原型方法</title>
</head>
<body>
    <button class="a">xiasnn</button>
    <button>xiaxia</button>
    <script>
        // 数组可以使用过滤方法
        let arr = [1,2,5,67];
        let it = arr.filter(item => {
            return item > 50;
        });
        console.log(it);


        let btns = document.querySelectorAll('button');
        // let button = Array.prototype.filter.call(btns,item => {
        //     return item.hasAttribute("class");
        // });
        // 直接调用对象也可以
        let button = arr.filter.call(btns,item => {
            return item.hasAttribute("class");
        });
        console.log(button);
    </script>
</body>
</html>